package com.culture.config.wrapper;

import java.util.Date;

import com.culture.config.dao.entity.App;
import com.culture.config.dao.entity.PropertyCopy;
import com.culture.config.model.po.ApplicationCopyPO;
import com.culture.config.util.AuthenticationUtil;

import lombok.experimental.UtilityClass;

@UtilityClass
public class PropertyCopyWrapper {
    
    public static PropertyCopy wrapAppCopy(ApplicationCopyPO copyPO, App newApp){
        PropertyCopy propertyCopy = new PropertyCopy(copyPO.getCopyId());
        propertyCopy.setCopyAppId(newApp.getId()).setCopyAppName(newApp.getName());
        propertyCopy.setCopyBy(AuthenticationUtil.getCurrentUserName());
        propertyCopy.setCopyTime(new Date());
        return propertyCopy;
    } 
}
